{% extends "base.html" %}

{% block title %}Pharm - Lista tari{% endblock title %}

{% block content_title %}<h1>Lista tari</h1>{% endblock content_title %}

{% block content %}
<p><a href="{% url country_createview %}">Creaza tara noua</a></p>
<ul>
    {% for c in country_list %}
        <li>{{ c.name }}<br>
            <a href="{% url country_detailview c.pk %}">Detalii</a>
            <a href="{% url country_updateview c.pk %}">Modifica</a>
            <a href="{% url country_deleteview c.pk %}">Sterge</a>
        </li>
    {% endfor %}
</ul>

{% if is_paginated %}
    <p>{{ page_obj.start_index }}&rarr;{{ page_obj.end_index }} din {{ page_obj.paginator.count }}</p>

    {% ifnotequal page_obj.number 1 %}
        <a href="?page=1">&laquo;</a>
    {% endifnotequal %}

    {% if page_obj.has_previous %}
        <a href="?page={{ page_obj.previous_page_number }}">&larr;</a>
    {% endif %}

    {% for pnum in page_obj.paginator.page_range %}
        {% ifequal pnum page_obj.number %}
            <strong>{{ pnum }}</strong>
        {% else %}
            <a href="?page={{ pnum }}">{{ pnum }}</a>
        {% endifequal %}
    {% endfor %}

    {% if page_obj.has_next %}
        <a href="?page={{ page_obj.next_page_number }}">&rarr;</a>
    {% endif %}

    {% ifnotequal page_obj.number page_obj.paginator.num_pages %}
        <a href="?page={{ page_obj.paginator.num_pages }}">&raquo;</a>
    {% endifnotequal %}
{% endif %}
{% endblock content %}
tent %}
